<#include "/commons/header.ftl">
<script type="text/javascript" src="${stx}/js/jquery/zTree/jquery.ztree-2.6.js"></script>
<link href="${stx}/js/jquery/zTree/zTreeStyle/zTreeStyle.css " type="text/css" rel="stylesheet" />
<style>
html,body{padding:0; margin:0;}
html{ 
scrollbar-face-color: #FFFFFF; scrollbar-shadow-color: #D2E5F4; scrollbar-highlight-color: #D2E5F4; scrollbar-3dlight-color: #FFFFFF; scrollbar-darkshadow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; scrollbar-arrow-color: #D2E5F4}
</style>
<body>    
    <div class="leftMenu" id="sidebar" ></div>
</body>
</html>
<script language="javascript" type="text/javascript">
addItem = window.top.addItem;//调用父页面的方法
var setting = {
    showLine: true
};
var zTreeNodes=[
<#list tree.childList?if_exists as treeMenu>
	<@treeNode child=treeMenu.childList parentNode=treeMenu.node/><#if treeMenu_has_next>,</#if>
</#list>
];
$(function(){
$("#sidebar").menuList(setting,zTreeNodes);
});
</script>
<#macro treeNode(child,parentNode)>
	{
	<#if parentNode?exists>
		id:'${parentNode.id?if_exists}',name:'${parentNode.bean.menuName?if_exists}'
		<#assign url=(parentNode.bean.menuUrl)!>
		<#if url?exists&&url?length gt 0>,click:"addItem({obj:jQuery(this),src:'<#if url?index_of("http:")!=-1||url?index_of("https:")!=-1>${url}<#else>${mvc_ctx+url}</#if>',menuId:'${parentNode.id?if_exists}'});"</#if>
	</#if>
	<#if child?exists && child?size gt 0>
    	<#if parentNode?exists>,</#if>
        nodes:[<#list child as temp>
            	<@treeNode child=temp.childList parentNode=temp.node/><#if temp_has_next>,</#if>
        	</#list>]
	</#if>}
</#macro>